package com.lagou.service.controller;

import com.lagou.service.MailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author : liuchangling
 * @Descrition :
 * @Date： Created in 1:55 下午 2022/1/31
 */
@RestController
@RequestMapping("/email")
public class MailController {
    @Autowired
    private MailService mailService;

    @RequestMapping("/{email}/{code}")
    public boolean sendEmail(@PathVariable("email") String email,@PathVariable("code") String code){
        return mailService.sendMail(email, code);
    }

    @RequestMapping("/{msg}")
    public String send(@PathVariable("msg") String msg){
        return mailService.send(msg);
    }
}
